package replaceWords;

import java.io.IOException;

public class WeiYuanChuang {
	

	public void wyc ()  {
		final String wordSpilt = "|";
		
		String contentNoMark = null;
		String wordSd = null;
		String wordReplace = null;
		String wordReplaceNoMark = null;
		Complex complexDiv = new Complex();
		MarkDeal md = new MarkDeal();
		md.setWordDBName(wordDBName);
		md.setWordHost(wordHost);
		ReplaceWord replaceword = new ReplaceWord();
		replaceword.setWordDBName(wordDBName);
		replaceword.setWordHost(wordHost);
					
					// 去掉标点符号
					contentNoMark = md.markdel(content);
					//System.out.println(contentNoMark);
					// 分词
					try {
						wordSd = complexDiv.segWords(contentNoMark, wordSpilt);
						//System.out.println(wordSd);
					} catch (IOException e) {
						
						e.printStackTrace();
					}
					// 替换
					wordReplace = replaceword.replaceNum(replaceword
							.replaceWord(wordSd));
					// 去掉|
					wordReplaceNoMark = wordReplace.replaceAll("\\|", "");
					// 恢复标点
					wordOK = md.markAdd(wordReplaceNoMark);						
			//}		
		 
		}
	
	String wordHost = null;
	String wordDBName = null;
	String content = null;
	public void setContent(String content) {
		this.content = content;
	}
	String wordOK = null;	
	public String getWordOK() {
		return wordOK;
	}
	public void setWordHost(String wordHost) {
		this.wordHost = wordHost;
	}
	public void setWordDBName(String wordDBName) {
		this.wordDBName = wordDBName;
	}	
}
